using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Neovolve.Windows.Forms
{
    /// <summary>
    /// The <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> class stores the settings for a button control in the
    /// <see cref="Neovolve.Windows.Forms.WizardForm"/> form.
    /// </summary>
    [
        TypeConverter(typeof(WizardButtonSettingsTypeConverter))
    ]
    public class WizardButtonSettings
    {
        #region Declarations

        /// <summary>
        /// Stores the text of the button.
        /// </summary>
        private String _text;

        /// <summary>
        /// Stores the enabled state of the button.
        /// </summary>
        private Boolean _enabled;

        /// <summary>
        /// Stores the visibility state of the button.
        /// </summary>
        private Boolean _visible;

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> class.
        /// </summary>
        /// <param name="textValue">The text value.</param>
        public WizardButtonSettings(String textValue)
            : this(textValue, true, true)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> class.
        /// </summary>
        /// <param name="textValue">The text value.</param>
        /// <param name="enabledValue">if set to <item>true</item> [enabled value].</param>
        public WizardButtonSettings(String textValue, Boolean enabledValue)
            : this(textValue, enabledValue, true)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> class.
        /// </summary>
        /// <param name="textValue">The text value.</param>
        /// <param name="enabledValue">if set to <item>true</item> [enabled value].</param>
        /// <param name="visibleValue">if set to <item>true</item> [visible value].</param>
        public WizardButtonSettings(String textValue, Boolean enabledValue, Boolean visibleValue)
        {
            _text = textValue;
            _enabled = enabledValue;
            _visible = visibleValue;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public WizardButtonSettings Clone()
        {
            // Return the new setting object
            return new WizardButtonSettings(Text, Enabled, Visible);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        /// <value>The text.</value>
        [
            Category("Display"),
            Description("Determines the text of the button."),
            NotifyParentProperty(true),
            DefaultValue("")
        ]
        public String Text
        {
            get { return _text; }
            set { _text = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> is enabled.
        /// </summary>
        /// <value><item>true</item> if enabled; otherwise, <item>false</item>.</value>
        [
            Category("Display"),
            Description("Determines whether the button is enabled."),
            NotifyParentProperty(true),
            DefaultValue(true)
        ]
        public Boolean Enabled
        {
            get { return _enabled; }
            set { _enabled = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="Neovolve.Windows.Forms.WizardButtonSettings"/> is visible.
        /// </summary>
        /// <value><item>true</item> if visible; otherwise, <item>false</item>.</value>
        [
            Category("Display"),
            Description("Determines whether the button is visible."),
            NotifyParentProperty(true),
            DefaultValue(true)
        ]
        public Boolean Visible
        {
            get { return _visible; }
            set { _visible = value; }
        }

        #endregion
    }
}
